473,471 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

convert XLS to CSV with charset convertion

Hi,

I have an excel file with charset "windows-1250" and i would like to
convert it to CSV file with charset "UTF-8"

how can i do that ?

thanks a lot,

Al.
Aug 15 '07 #1
3 6488
Alain,

Do you have Excel installed on the machine and are you running this in a
non-ASP.NET application? If so, then I would automate Excel to open up the
file, and then just call the SaveAs method on the workbook, specifying the
CSV file format.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alain R." <no*****@nospam.comwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
Hi,

I have an excel file with charset "windows-1250" and i would like to
convert it to CSV file with charset "UTF-8"

how can i do that ?

thanks a lot,

Al.

Aug 15 '07 #2
Hi,

so yes, excel is installed on the computer and it should run under
C#.net program only.

for now, i did the following thing :
open an OLEDB connection to excel file and line by line save it to
another file format CSV.

and i would like to convert string (line) to UTF-8 before saving it to CSV.

Al.

Nicholas Paldino [.NET/C# MVP] wrote:
Alain,

Do you have Excel installed on the machine and are you running this in a
non-ASP.NET application? If so, then I would automate Excel to open up the
file, and then just call the SaveAs method on the workbook, specifying the
CSV file format.

Aug 15 '07 #3
Alain,

That seems pretty roundabout, and too much code that you have to put
together.

Why not just call this?

http://msdn2.microsoft.com/en-us/lib...as(VS.80).aspx

Here is some more information on saving workbooks in Excel:

http://msdn2.microsoft.com/en-us/lib...36(VS.80).aspx

Note that you will want to set the FileFormat parameter to xlCSV. For
more information on file formats, check here:

http://msdn2.microsoft.com/en-us/lib...at(VS.80).aspx
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Alain R." <no*****@nospam.comwrote in message
news:Of****************@TK2MSFTNGP06.phx.gbl...
Hi,

so yes, excel is installed on the computer and it should run under C#.net
program only.

for now, i did the following thing :
open an OLEDB connection to excel file and line by line save it to another
file format CSV.

and i would like to convert string (line) to UTF-8 before saving it to
CSV.

Al.

Nicholas Paldino [.NET/C# MVP] wrote:
>Alain,

Do you have Excel installed on the machine and are you running this
in a non-ASP.NET application? If so, then I would automate Excel to open
up the file, and then just call the SaveAs method on the workbook,
specifying the CSV file format.
Aug 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Swarup | last post by:
I am reading a file (txt, xml, gif, ico, bmp etc) byte by byte and filling it into a byte arry. Now i have to convert it into a string to store it in the database. I use...
2
by: Du Dang | last post by:
I tried to convert a block of text from iso-8859-1 to utf-8 but all I got after the convertion is gibberish. =============================== FileStream fs = File.Open("text.txt",...
4
by: Albert Jan | last post by:
Hi, I have text from mime email messages with different encoding that I want to convert to utf-8, but I'm relatively new on encoding problems. I use the following code, but this doesn't seem...
7
by: EOS | last post by:
Hi, I would like to ask on how to convert array of bytes, Byte into String? I tried StringIwant = System.Convert.ToString(byteData); but it actually return "System.Byte" rather than convert...
6
by: PenguinPig | last post by:
Dear All Experts I would like to know how to convert a HTML into Image using C#. Or allow me contains HTML code (parsed) in Image? I also tried this way but it just display the character "<" &...
2
by: ElizaInternet | last post by:
I need convert NITF Xmls for insert into BD SQL. I try convert to file text and then insert into BD I used the Syndication:NITF of perl for this convertion. Any have information about this??, I...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
0
by: Zmische | last post by:
Platform: IIS6, windows 2000 Server, ASP + VBSCRIPT I have an ASP application that posts FORM via XMLHttprequest (javascript) so that all data is posted in UTF-8. So I have an ASP that get data in...
0
by: Michael Postmann | last post by:
Hello! I have Oracle 10g using AL32UTF8 as internal charset. I have a documents table where uploaded files (I'm using modplsql web-gateway (release 8i)) are stored in a blob-column. I upload a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.